<?php

/**
 * AccountBank form base class.
 *
 * @method AccountBank getObject() Returns the current form's model object
 *
 * @package    erpcrm
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseAccountBankForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'iden'             => new sfWidgetFormInputHidden(),
      'contact_iden'     => new sfWidgetFormPropelChoice(array('model' => 'Contact', 'add_empty' => false)),
      'name'             => new sfWidgetFormInputText(),
      'initials'         => new sfWidgetFormInputText(),
      'branch'           => new sfWidgetFormInputText(),
      'swift_code'       => new sfWidgetFormInputText(),
      'street_address'   => new sfWidgetFormTextarea(),
      'city'             => new sfWidgetFormInputText(),
      'country'          => new sfWidgetFormInputText(),
      'zip_code'         => new sfWidgetFormInputText(),
      'country_code'     => new sfWidgetFormInputText(),
      'area_code'        => new sfWidgetFormInputText(),
      'phone'            => new sfWidgetFormInputText(),
      'fax'              => new sfWidgetFormInputText(),
      'email'            => new sfWidgetFormInputText(),
      'contact_person'   => new sfWidgetFormInputText(),
      'contact_position' => new sfWidgetFormInputText(),
      'account_number'   => new sfWidgetFormInputText(),
      'account_name'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'iden'             => new sfValidatorPropelChoice(array('model' => 'AccountBank', 'column' => 'iden', 'required' => false)),
      'contact_iden'     => new sfValidatorPropelChoice(array('model' => 'Contact', 'column' => 'iden')),
      'name'             => new sfValidatorString(array('max_length' => 100)),
      'initials'         => new sfValidatorString(array('max_length' => 10)),
      'branch'           => new sfValidatorString(array('max_length' => 50)),
      'swift_code'       => new sfValidatorString(array('max_length' => 50)),
      'street_address'   => new sfValidatorString(),
      'city'             => new sfValidatorString(array('max_length' => 50)),
      'country'          => new sfValidatorString(array('max_length' => 50)),
      'zip_code'         => new sfValidatorString(array('max_length' => 10)),
      'country_code'     => new sfValidatorString(array('max_length' => 10)),
      'area_code'        => new sfValidatorString(array('max_length' => 10)),
      'phone'            => new sfValidatorString(array('max_length' => 50)),
      'fax'              => new sfValidatorString(array('max_length' => 50)),
      'email'            => new sfValidatorString(array('max_length' => 50)),
      'contact_person'   => new sfValidatorString(array('max_length' => 200)),
      'contact_position' => new sfValidatorString(array('max_length' => 50)),
      'account_number'   => new sfValidatorString(array('max_length' => 50)),
      'account_name'     => new sfValidatorString(array('max_length' => 200)),
    ));

    $this->widgetSchema->setNameFormat('account_bank[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AccountBank';
  }


}
